home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / ActiveX Controlls / NCTAudioEditor2 ActiveX DLL / NCTAudioEditor2.exe / {app} / Samples / TestVCAudioEditor2 / MainFrm.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2003-04-03  |  2.4 KB  |  109 lines

  1. // MainFrm.cpp : implementation of the CMainFrame class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "TestVCAudioEditor.h"
  6.  
  7. #include "MainFrm.h"
  8.  
  9. #ifdef _DEBUG
  10. #define new DEBUG_NEW
  11. #undef THIS_FILE
  12. static char THIS_FILE[] = __FILE__;
  13. #endif
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CMainFrame
  17.  
  18. IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
  19.  
  20. BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
  21.     //{{AFX_MSG_MAP(CMainFrame)
  22.         // NOTE - the ClassWizard will add and remove mapping macros here.
  23.         //    DO NOT EDIT what you see in these blocks of generated code !
  24.     ON_WM_CREATE()
  25.     //}}AFX_MSG_MAP
  26. END_MESSAGE_MAP()
  27.  
  28. static UINT indicators[] =
  29. {
  30.     ID_INDICATOR_I1,
  31.     ID_INDICATOR_I2,
  32.     ID_INDICATOR_I3,
  33.     ID_INDICATOR_I4,
  34.     ID_INDICATOR_I5,
  35. };
  36.  
  37. /////////////////////////////////////////////////////////////////////////////
  38. // CMainFrame construction/destruction
  39.  
  40. CMainFrame::CMainFrame()
  41. {
  42.     // TODO: add member initialization code here
  43.     
  44. }
  45.  
  46. CMainFrame::~CMainFrame()
  47. {
  48. }
  49.  
  50. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  51. {
  52.     if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
  53.         return -1;
  54.     
  55.     if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
  56.         | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
  57.         !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
  58.     {
  59.         TRACE0("Failed to create toolbar\n");
  60.         return -1;      // fail to create
  61.     }
  62.  
  63.     if (!m_wndStatusBar.Create(this) ||
  64.         !m_wndStatusBar.SetIndicators(indicators,
  65.           sizeof(indicators)/sizeof(UINT)))
  66.     {
  67.         TRACE0("Failed to create status bar\n");
  68.         return -1;      // fail to create
  69.     }
  70.  
  71.     // TODO: Delete these three lines if you don't want the toolbar to
  72.     //  be dockable
  73.     m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
  74.     EnableDocking(CBRS_ALIGN_ANY);
  75.     DockControlBar(&m_wndToolBar);
  76.  
  77.     return 0;
  78. }
  79.  
  80. BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
  81. {
  82.     if( !CFrameWnd::PreCreateWindow(cs) )
  83.         return FALSE;
  84.     // TODO: Modify the Window class or styles here by modifying
  85.     //  the CREATESTRUCT cs
  86.  
  87.     return TRUE;
  88. }
  89.  
  90. /////////////////////////////////////////////////////////////////////////////
  91. // CMainFrame diagnostics
  92.  
  93. #ifdef _DEBUG
  94. void CMainFrame::AssertValid() const
  95. {
  96.     CFrameWnd::AssertValid();
  97. }
  98.  
  99. void CMainFrame::Dump(CDumpContext& dc) const
  100. {
  101.     CFrameWnd::Dump(dc);
  102. }
  103.  
  104. #endif //_DEBUG
  105.  
  106. /////////////////////////////////////////////////////////////////////////////
  107. // CMainFrame message handlers
  108.  
  109.